package com.guodu.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guodu.base.BaseDao;
import com.guodu.dao.ViewMaterialAppraisalDao;
import com.guodu.entity.ViewMaterialAppraisal;
import com.guodu.entity.ViewMaterialAppraisalYear;

@Repository("viewMaterialAppraisalDao")
public class ViewMaterialAppraisalDaoImpl extends BaseDao implements ViewMaterialAppraisalDao {

	@Override
	public List<ViewMaterialAppraisal> findByMonth(String month) {
		// TODO Auto-generated method stub
		String hql = "from ViewMaterialAppraisal where createMonth='"+month+"'";
		return super.find(hql);
	}

	@Override
	public List<ViewMaterialAppraisalYear> findByYear(String month) {
		// TODO Auto-generated method stub
		String hql = "from ViewMaterialAppraisalYear where createMonth='"+month.split("-")[0]+"' or createMonth is null";
		return super.find(hql);
	}

}
